<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>系统登录</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	<link href="ExtJS/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="ExtJS/bootstrap.js"></script>
	<script type="text/javascript" src="ExtJS/ext-all.js"></script>
	
	<script type="text/javascript">
	 	Ext.onReady(function(){
		//使用表单提示
		Ext.QuickTips.init();
		Ext.form.Field.prototype.msgTarget ="side";
		//定义一个输入表单
		var simple = new Ext.FormPanel({
		labelWidth:40,
		baseCls:'x-plain',
		defaults:{width:180},
		items:[{
		xtype:'textfield',
		fieldLabel:'账号',
		name:'user.username',
		allowBlank:false,
		blankText:'账号不能为空'
		},{
		xtype:'textfield',
		inputType:"password",
		fieldLabel:"密码",
		name:'user.password',
		allowBlank:false,
		blankText:"密码不能为空"
		}],
		buttons:[{
		text:"提交",
		type:"submit",
		handler:function(){
		if(simple.form.isValid()){
		Ext.MessageBox.show({
		title:"请等待",
		msg:"系统登录",
		progressText:"正在验证登录",
		width:300,
		progress:true,
		closable:false,
		animEl:'loding'
		});
		
		var f = function(v){
		return function(){
		var i = v/11;
		Ext.MessageBox.updateProgress(i,'');
		}
		}
		
		for(var i = 1; i < 13; i++){
		setTimeout(f(i),i * 150);
		}
		
		//提交到服务器操作
		simple.form.doAction("submit",{
		url:"login/login.action",
		method:"post",
		success:function(form,action){
		document.location = 'index.html';
		//Ext.Msg.alert("登录成功！",action.result.message);
		},
		failure:function(form, action){
		
		Ext.Msg.alert('登录失败',action.result.message);
		}
		
		});
		}
		}
		},{
		text:"重置",
		handler:function(){
		//重置表单
		simple.form.reset();
		}
		}]
		});
		//定义窗体
		var _window = new Ext.Window({
		title:"登录窗口",
		layout:"fit",
		width:280,
		height:150,
		plain:true,
		bodyStyle:"padding:10px",
		maximizable:false,
		closeAction:"close",
		closable:false,
		collapsible:true,
		plain:true,
		buttonAlign:"center",
		items:simple
		});
		_window.show();
		}); 
	</script> 
  </head>
  
  <body> 
    欢迎您使用考核管理系统&mdash;企业2.0 <br>
  </body>
</html>
